﻿@{
    ViewBag.Title = "数据恢复";
}
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
     @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
<script>


</script>
    <script type="text/javascript">
        $(document).ready(function () {
            var hdjsAlert = $("#hdjsAlert").val();
            if (hdjsAlert != "") {
                alert(hdjsAlert);
            }
        });

        function ok() {
            if (ASPxClientDateEdit.Cast("EndDate").GetDate() != null &&
                ASPxClientDateEdit.Cast("BeginDate").GetDate() != null) {

                if (confirm("导入时该时间段数据将被删除确定导入数据？")) {
                    lpModal.Show();

                    $.ajax({
                        type: 'POST',
                        url: rootPath + '/DSImportDate/DSImportDate',
                        data: { beginDate: ASPxClientDateEdit.Cast("BeginDate").GetText(), endDate: ASPxClientDateEdit.Cast("EndDate").GetText() },
                        success: function (result) {
                            if (result == "e") {
                                alert("系统异常");
                                lpModal.Hide();
                            }
                            else if (result == "ok") {
                                alert("操作成功");
                                lpModal.Hide();
                            }
                            else {
                                alert(result);
                                lpModal.Hide();
                            }
                        }
                    });
                }
            }
            else {
                alert("请选择入库起止时间！");
                return;
            }

        }

    </script>



</head>
<body>
    @using (Html.BeginForm("GSImportDate", "TaxManager", FormMethod.Post, new { id = "form1" }))
    {
        <br />
        <div class="div">
        <table width="99%" align="center" class="tableForm">
            <tr>
                <th align="right" width="20%">
                    操作说明:</th>
                <td class="tdClass">
                <br />
                    数据导入时已存在数据将被覆盖请谨慎操作！
                    <br />
                     <br />
                </td>
            </tr>
            <tr>
                <th align="right" width="20%">
                    入库日期:</th>
                <td class="tdClass">
                <table>
                <tr>
                <td>
                @Html.DevExpress().DateEdit(settings => {
              settings.Name = "BeginDate";
              settings.Properties.ShowShadow = true;
              settings.Properties.EditFormat = EditFormat.Date;
              settings.Properties.EditFormatString = "yyyy-MM-dd";
              settings.Properties.MinDate = DateTime.Parse("1900-01-01");
              settings.Properties.UseMaskBehavior = true;
           }).GetHtml()
                </td>
                
                    <td>     -
                </td>
                    <td>
                               @Html.DevExpress().DateEdit(settings =>
                               {
                                   settings.Name = "EndDate";
                                   settings.Properties.ShowShadow = true;
                                   settings.Properties.EditFormat = EditFormat.Date;
                                   settings.Properties.EditFormatString = "yyyy-MM-dd";
                                   settings.Properties.MinDate = DateTime.Parse("1900-01-01");
                                   settings.Properties.UseMaskBehavior = true;
                               }).GetHtml()
                </td>
                </tr>
                </table>
               </td>
            </tr>
            <tr>
                <th></th>
                <td  class="tbClass">

                @Html.DevExpress().Button(settings =>
           {
               settings.Name = "btnOK";
               settings.Text = "确定导入";
               settings.ControlStyle.CssClass = "button";
               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/ok.png");
               settings.ClientSideEvents.Click = "ok";
           }).GetHtml()
            </td>
            </tr>
            
        </table>
    </div>
         @Html.Hidden("hidMessage", ViewData["message"])
         @Html.Hidden("hidIsClose", ViewData["IsClose"])
         @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]));

    }
    <script>
        lp.Hide();
    </script>

</body>
</html>
